#include <iostream>

using namespace std;

class IntPtr
{
	int* _p = NULL;

public:
	IntPtr(int* p) { _p = p; }

	IntPtr& operator++ () 
	{ 
		_p += 1;
		return *this;
	}

	IntPtr operator++ (int)
	{ 
		auto tmp = _p;
		_p += 1;
		return tmp;
	}

	int& operator[] (int i) { return _p[i]; }
	int& operator* () { return *_p; }
};

int main()
{
	int arr[3] = { 1 ,2 ,3 };
	IntPtr p1 = arr;
	for (int i = 0; i < 3; ++i, ++p1)
		cout << *p1 << endl;

	IntPtr p2 = arr;
	cout << p2[0] << " " << p2[1] << " " << p2[2] << endl;

	return 0;
}